﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClienteMarkup.aspx.cs" Inherits="NewTierra.Pages.Cliente.ClienteMarkup" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>

    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="../../Styles/EstiloGeral.css" rel="stylesheet" />

    <title></title>

    <style type="text/css">
        #Markup
        {
            height: 356px;
            width: 1048px;
        }

            #Markup .FormMarkup
            {
                height: 344px;
                width: 437px;
                float: left;
            }

        .FormMarkup .box_form
        {
            height: 51px;
            width: 168px;
            float: left;
        }

        .FormMarkup .box_form_footer
        {
            float: left;
            width: 427px;
            height: 36px;
        }

        #Markup .GridMarkups
        {
            width: 588px;
            float: left;
            margin-left: 15px;
            height: 305px;
            margin-top: 10px;
        }
    </style>

    <script type="text/javascript">

        function showAutoCloseMessage(MsgsExc) {
            showNotification({
                message: MsgsExc,
                autoClose: true,
                type: "success",
                duration: 5
            });
        }

        jQuery(function ($) {
            $.datepicker.regional['pt-BR'] = {
                closeText: 'Fechar',
                prevText: '&#x3c;Anterior',
                nextText: 'Pr&oacute;ximo&#x3e;',
                currentText: 'Hoje',
                monthNames: ['Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho',
             'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
                monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
             'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                dayNames: ['Domingo', 'Segunda-feira', 'Ter&ccedil;a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sabado'],
                dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                dayNamesMin: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                weekHeader: 'Sm',
                dateFormat: 'dd/mm/yy',
                firstDay: 0,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: ''
            };
            $.datepicker.setDefaults($.datepicker.regional['pt-BR']);
        });

        $(function () {
            $("#txtDataInicial").datepicker({
                defaultDate: "+1w",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#txtDataFinal").datepicker("option", "minDate", selectedDate);
                }
            });
            $("#txtDataFinal").datepicker({
                defaultDate: "+1w",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#txtDataInicial").datepicker("option", "maxDate", selectedDate);
                }
            });
            $.datepicker.formatDate('yyyy-mm-dd');
        });

    </script>
</head>
<body>

    <form id="form1" runat="server">

        <div id="Markup">

            <div class="FormMarkup">

                <fieldset style="height: 310px">
                    <legend>Cliente Markup</legend>

                    <asp:TextBox ID="txtCodMarkup" runat="server" Visible="false" />

                    <div class="box_form">
                        <asp:Label ID="lblDataInicial" runat="server" Text="Data inicial:" /><br />
                        <asp:TextBox ID="txtDataInicial" runat="server" Text="" MaxLength="10" Width="100px" />
                        <asp:RequiredFieldValidator
                            ID="RqDtInicial"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtDataInicial"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblDataFinal" runat="server" Text="Data final:" /><br />
                        <asp:TextBox ID="txtDataFinal" runat="server" Text="" MaxLength="10" Width="100px" />
                        <asp:RequiredFieldValidator
                            ID="RqDtFinal"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtDataFinal"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblMarkupHotel" runat="server" Text="Markup hotel:" /><br />
                        <asp:TextBox ID="txtMarkupHotel" runat="server" Text="" MaxLength="10" Width="80px" />
                        <asp:RequiredFieldValidator
                            ID="RqMakHotel"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupHotel"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblMarkupDescHotel" runat="server" Text="Markup desconto hotel:" /><br />
                        <asp:TextBox ID="txtMarkupDescHotel" runat="server" Text="" MaxLength="10" Width="80px" />
                        <asp:RequiredFieldValidator
                            ID="RqMakDescHotel"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupDescHotel"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblMarkupServico" runat="server" Text="Markup serviço:" /><br />
                        <asp:TextBox ID="txtMarkupServico" runat="server" Text="" MaxLength="10" Width="80px" />
                        <asp:RequiredFieldValidator
                            ID="RqMakServico"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupServico"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblMarkupDescServico" runat="server" Text="Markup desconto serviço:" /><br />
                        <asp:TextBox ID="txtMarkupDescServico" runat="server" Text="" MaxLength="10" Width="80px" />
                        <asp:RequiredFieldValidator
                            ID="RqMakDescServico"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupDescServico"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblSeasonal" runat="server" Text="Markup seasonal:" /><br />
                        <asp:TextBox ID="txtMarkupSeasonal" runat="server" Text="" MaxLength="10" Width="80px" />
                        <asp:RequiredFieldValidator
                            ID="RqMakSeasonal"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupSeasonal"
                            ValidationGroup="Salvar" />
                    </div>

                    <div class="box_form">
                        <asp:Label ID="lblMeal" runat="server" Text="Markup meal:" /><br />
                        <asp:TextBox ID="txtMarkupMeal" runat="server" Text="" MaxLength="10" Width="80px" />
                        <%--<asp:RequiredFieldValidator
                            ID="RqMakMeal"
                            runat="server"
                            ErrorMessage="*"
                            CssClass="MsgErro"
                            ToolTip="Campo obrigatório"
                            ControlToValidate="txtMarkupMeal"
                            ValidationGroup="Salvar" />--%>
                    </div>

                    <div class="box_form_footer">
                        Cliente:
                        <asp:Label ID="lblCliente" runat="server" Text="" />
                    </div>

                    <div class="box_form_footer">
                        <asp:Button ID="btnNovoMarkup" CssClass="btnGeralAzul" runat="server" Text="Salvar" ValidationGroup="Salvar" OnClick="SalvarMarkup" />
                        &nbsp;<asp:Button ID="btnUpdateMarkup" CssClass="btnGeralAzul" runat="server" Text="Atualizar" ValidationGroup="Salvar" OnClick="AtualizarMarkup" />
                        &nbsp;<asp:Button ID="btnLimpar" CssClass="btnGeralAzul" runat="server" Text="Limpar" OnClick="btnLimpar_Click" />
                        &nbsp;<asp:Button ID="btnFechar" CssClass="btnGeralAzul" runat="server" OnClientClick="window.close();" Text="Fechar" />
                    </div>

                    <div class="box_form_footer">
                        <asp:Label ID="lblMsgCadMarkup" runat="server" Text="" CssClass="MsgErro" />
                    </div>

                </fieldset>
            </div>

            <div class="GridMarkups">

                <asp:GridView ID="GridMarkup" runat="server" AllowPaging="True"
                    AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr"
                    AlternatingRowStyle-CssClass="alt" EmptyDataText="Não existe markup para esse cliente."
                    Height="16px" PageSize="5" Width="581px">
                    <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                    <Columns>

                        <asp:BoundField DataField="Markup_dataInicial" HeaderText="Inicial" SortExpression="Markup_dataInicial" DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:BoundField DataField="Markup_dataFinal" HeaderText="Final" SortExpression="Markup_dataFinal" DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:BoundField DataField="Markup_hotel" HeaderText="Hotel" SortExpression="Markup_hotel" />
                        <asp:BoundField DataField="Markup_descontoHotel" HeaderText="Desc Hotel" SortExpression="Markup_descontoHotel" />
                        <asp:BoundField DataField="Markup_servico" HeaderText="Serviço" SortExpression="Markup_servico" />
                        <asp:BoundField DataField="Markup_descontoServico" HeaderText="Desc Serviço" SortExpression="Markup_descontoServico" />
                        <asp:BoundField DataField="Markup_seasonal" HeaderText="Seasonal" SortExpression="Markup_seasonal" />
                        <asp:BoundField DataField="Markup_meals" HeaderText="Meal" SortExpression="Markup_meals" />


                        <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgBtnEditarMarkup"
                                    runat="server" ToolTip="Editar Markup"
                                    CommandArgument='<%# Eval("Markup_id") %>'
                                    OnCommand="EditarMarkup" ImageUrl="~/images/Icones/edit.png" />
                            </ItemTemplate>
                            <HeaderStyle Wrap="False" />
                            <ItemStyle Wrap="False" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgBtnExcluirMarkup"
                                    runat="server" ToolTip="Excluir Markup"
                                    CommandArgument='<%# Eval("Markup_id") %>'
                                    OnCommand="ExcluirMarkup" ImageUrl="~/images/Icones/delete.png" />
                            </ItemTemplate>
                            <HeaderStyle Wrap="False" />
                            <ItemStyle Wrap="False" />
                        </asp:TemplateField>

                    </Columns>

                    <PagerStyle CssClass="pgr"></PagerStyle>
                </asp:GridView>

            </div>

        </div>

    </form>

</body>
</html>
